<?php
class AppModel extends Model {
	
	function setLocale($locale) {
		$this->locale = $locale;
	}
	
	function getNextAutoIncrement() {
		$next_increment = 0;
		$table = Inflector::tableize($this->name);
		$query = "SHOW TABLE STATUS LIKE '$table'";
		$db =& ConnectionManager::getDataSource($this->useDbConfig);
		$result = $db->rawQuery($query);
		
		while ($row = mysql_fetch_assoc($result)) {
			$next_increment = $row['Auto_increment'];
		}
		
		return $next_increment;
	}
	
}
?>